// 引入样式
import "../../assets/css/normalize.less";
import "../../assets/css/reset.less";
import "../../assets/css/property.less";
import "../../assets/css/basic.less";
import "./my.less";

import { $ } from "../../utils/dom";

import "../../assets/fonts/font_kok358gumca/iconfont.css";
import "../../assets/fonts/font_iysuojan2xi/iconfont.css";

// 跳转到myInfo页面
$("#icon").addEventListener("click", () => {
	location.href="./myInfo.html"
});



import { showBottomNav } from "../../utils/nav";
import { getUserInfoReq } from "../../api/user";

/**
 * 导航栏
 */
showBottomNav("my");

/**
 * 获取用户信息
 */

const getUserInfo = async () => {
	let res = await getUserInfoReq();
	let { errno, data } = res.data;
	console.log(res.data);
	if(errno===0){
		$("#nickName").textContent = data.nickName
		$(".sign").textContent = data.sign


		// 将用户信息保存在sessionStorage
		sessionStorage.setItem("userInfo",JSON.stringify(data))
	}
	
};
getUserInfo()




$("#sportsData").addEventListener("click",()=>{
	location.href="./sportsData.html"
})


